#ifndef ANALISIS_DIALOG_H
#define ANALISIS_DIALOG_H

#include <QDialog>
#include "common/qcustomplot.h"

namespace Ui {
class Analisis_dialog;
}

typedef QVector<double> doublevalues;

class Analisis_dialog : public QDialog
{
    Q_OBJECT

public:
    explicit Analisis_dialog(QWidget *parent = 0);
    ~Analisis_dialog();

    void drawAirfoil(QCustomPlot *customPlot);

    void set_domain_variable(const QString &domain_variable);
    void set_image_variables(const QVector<QString> &image_variables);
    void add_values(double x_value, const QMap<QString, doublevalues> &y_values);

private slots:
    void image_value_selected(const QString &y_value);
    void time_value_selected(const QString &time_value);
    void connect_buttons();
    void close_button_pressed();
    void retranslateUi();

private:
    QPair<double, double> get_min_max(const QVector<double> &vector);

private:
    Ui::Analisis_dialog *ui;

    QString domain;
    QVector<QString> image;

    QVector<QMap<QString, doublevalues>> image_map; // <Coefficient, values>

    QVector<double> domain_values;
    QVector<double> image_values;
};

#endif // ANALISIS_DIALOG_H
